<script>
  import {h} from 'vue/dist/vue.esm-bundler.js'
  
  export default {
    props: ['item'],
    render() {
      let {code, comp} = this.item
      if (Array.isArray(code)) {
        code = code[0].code
      }
      let template = code.trim()
      if (template.startsWith('<template>')) {
        template = template.replace(/<template>([\s\S]+)<\/template>[\s\S]*/, '\$1')
      }
      return h({template, ...comp})
    }
  }
</script>

<style>
</style>
